<template>
	<view class="flex px-2 pt-2 border-bottom">
		<view class="flex flex-1 flex-column align-center " :class="current === index ? 'current-tab':''"
			style="color:#888;" v-for="(item,index) in tabs" :key="index" @click="$emit('change',index)">
			<text>{{item.name}}</text>
			<view v-if="current === index" class="tab-line mt-2 rounded animate__animated animate__fadeIn animate__faster"  />
		</view>
	</view>
</template>

<script>
	export default {
		name: "tabs",
		props: {
			current: {
				type: Number,
				default: 0
			},
			tabs:Array
		},
		data() {
			return {
				
			};
		},
		methods: {
			// changeCurrent(index) {
			// 	this.current =index
			// }
		},
	}
</script>

<style scoped lang="less">
	.current-tab {
		text {
			color: #00cf8a;
		}
		.tab-line {
			width: 50rpx;
			height: 10rpx;
			background-color: #00cf8a;
			border-radius: 8rpx;
		}
	}
</style>
